<%@page import="systems.ConfigSystem"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="entities.SiteConfig"%>
<%
SiteConfig siteConfig = ConfigSystem.getConfigs();
String title = (String) request.getParameter("title");
String description = (String) request.getParameter("description");
String keywords = (String) request.getParameter("keywords");
String ogSiteName = (String) request.getParameter("ogsite_name");
String ogTitle = (String) request.getParameter("ogtitle"); 
String ogUrl = (String) request.getParameter("ogurl");
String ogImage = (String) request.getParameter("ogimage");
String ogDescription = (String) request.getParameter("ogdescription");

if (title == null && siteConfig != null)
	title = siteConfig.getTitle();

if (description == null && siteConfig != null)
	description = siteConfig.getMetaDescription();

if (keywords == null && siteConfig != null)
	keywords = siteConfig.getMetaKeywords();

if (ogSiteName == null && siteConfig != null)
	ogSiteName = siteConfig.getSiteName();

if (ogTitle == null && siteConfig != null)
	ogTitle = siteConfig.getTitle();

if (ogDescription == null && siteConfig != null)
	ogDescription = siteConfig.getMetaDescription();

if (ogUrl == null)
	ogUrl = UrlHelper.getServerUrl(request);

if (ogImage == null)
	ogImage = "http://immediatenet.com/t/t_a?Size=1024x768&URL=" + UrlHelper.getDomainServer(request);

%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=<%=siteConfig.getHttpCharacterSet().toUpperCase()%>" />
<meta name="description" content="<%=description.replaceAll("[\"\']+", "")%>" >
<meta name="Keywords" content="<%=keywords.replaceAll("[\"\']+", "")%>" >
<meta itemprop="name" content="<%=ogTitle.replaceAll("[\"\']+", "")%>" />    
<meta itemprop="description" content="<%=ogDescription %>" />
<meta property="og:site_name" content="<%=ogSiteName %>" >
<meta property="og:title" content="<%=ogTitle.replaceAll("[\"\']+", "")%>" >
<meta property="og:url" content="<%=ogUrl%>" >
<meta property="og:image" content="<%=ogImage%>" >
<meta property="og:description" content="<%=ogDescription %>" >
<title><%=title%></title>

<link href="/templates/default/css/bootstrap.css" rel="stylesheet" media="screen">
<link href="/templates/default/css/style.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="/templates/default/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/templates/default/js/bootstrap.js"></script>
</head>
<body>
<header id="header">
	<div class="container">
		<div class="row">
			<div class="span4">
				<div class="logo">
					<h1>
						<%
						String logo = siteConfig.getLogo();
						if (logo.isEmpty()) {
							logo = "/templates/default/images/logo.png";
						}
						%>
						<a href="/"><img src="<%=logo %>" /></a>
					</h1>
				</div>
			</div>
			<div class="span5 offset3">
				<div class="list">
					<!-- AddThis Button BEGIN -->				
					<div class="addthis_toolbox addthis_default_style ">
					<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
					<a class="addthis_button_tweet" tw:via="showdomain"></a>
				
					<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
					<a class="addthis_counter addthis_pill_style"></a>
					</div>
		            <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f4f217074402877"></script>
		            <!-- AddThis Button END -->

				</div>
			</div>
		</div>
	</div>	
</header>

<div class="navbar">
	<div class="navbar-inner">
		<div class="container">
			<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> Menu </a>
			<div class="nav-collapse">
				<!-- Navigation links starts here -->
				<ul class="nav">
					<!-- Main menu -->
					<li><a href="/">Home</a></li>
					<li><a href="/ip">CheckIp</a></li>
					<li><a href="/whois">Whois</a></li>
					<li><a href="/rip">Reverse IP</a></li>
					<li><a href="/kranking">Keywords</a></li>
				</ul>
				
				<form class="navbar-search pull-right" action="/goto">
				  <input type="text" class="search-query" placeholder="Search" name="q">
				</form>
			</div>
		</div>
	</div>
</div>

<div id="content">
	<div class="container">